package com.mic.yzzn.plc.model;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Created by ASH on 16/4/18.
 */
public class PLCWriteResponse extends PLCResponse {

    /** 
     * string: e.g. R200F D20000
     * 写响应返回的数据 */
    private Map<String, PLCPointData> dataMap;
    
    public PLCWriteResponse()
    {
    	super();
    }
    
	public PLCWriteResponse(Date time, int status, Map<String, PLCPointData> dataMap) {
		super(time, status);
		this.dataMap = dataMap;
	}

	@Override
	public String toString() {
		StringBuffer stringBuffer = new StringBuffer();
		if (dataMap != null) {
			Set<String> keys = dataMap.keySet();
			for (String k : keys) {
				stringBuffer.append(k + ": ");
				stringBuffer.append(dataMap.get(k) + "\n");
			}
		} else {
			stringBuffer.append("dataMap is NULL");
		}
		return stringBuffer.toString();
	}

	// getters and setters
	
	public Map<String, PLCPointData> getDataMap() {
		return dataMap;
	}

	public void setDataMap(Map<String, PLCPointData> dataMap) {
		this.dataMap = dataMap;
	}

	

    
    
    
}
